Skip to content

[ExecuTorch][WebGPU] Test: rms_norm workgroup size is runtime-configurable#20956

Open
JCNTH wants to merge 2 commits into
gh/JCNTH/88/basefrom
gh/JCNTH/88/head
Open

[ExecuTorch][WebGPU] Test: rms_norm workgroup size is runtime-configurable#20956
JCNTH wants to merge 2 commits into
gh/JCNTH/88/basefrom
gh/JCNTH/88/head

Conversation

@JCNTH

@JCNTH JCNTH commented Jul 15, 2026

Copy link
Copy Markdown

Stack from ghstack (oldest at bottom):

Add a native gtest that locks the wg-size configurability guarantee: the same rms_norm WGSL, run at override wg_size 64 and 128, must produce the same output. Module::forward always uses the handler-clamped size (64), so the test builds the compute pipeline directly and sets wg_size via a WGPUConstantEntry, mirroring the runtime pipeline setup + WebGPUGraph::copy_outputs readback.

Key changes:

  • test/test_webgpu_native.cpprun_rms_norm_at_wg() standalone-pipeline helper + RmsNormWorkgroupSizeConfigurable test (element-wise agree within abs 1e-4 / rel 1e-3, plus a non-zero sanity guard).

Self-contained (no .pte/export), so it runs inside webgpu_native_test under test_webgpu_native_ci.sh with no new wiring. Absolute rms_norm correctness stays covered by the model-driven golden tests; this adds the "128 matches 64" guarantee.

Co-authored-with: Claude Code.
@exported-using-ghexport

Differential Revision: D112060302

Differential Revision: D112060302

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20956

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 0caed86 with merge base e500fee (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 15, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

[ghstack-poisoned]
JCNTH added a commit that referenced this pull request Jul 15, 2026
…rable

Pull Request resolved: #20956

Add a native gtest that locks the wg-size configurability guarantee: the same rms_norm WGSL, run at override `wg_size` 64 and 128, must produce the same output. `Module::forward` always uses the handler-clamped size (64), so the test builds the compute pipeline directly and sets `wg_size` via a `WGPUConstantEntry`, mirroring the runtime pipeline setup + `WebGPUGraph::copy_outputs` readback.

Key changes:
- `test/test_webgpu_native.cpp` — `run_rms_norm_at_wg()` standalone-pipeline helper + `RmsNormWorkgroupSizeConfigurable` test (element-wise agree within abs 1e-4 / rel 1e-3, plus a non-zero sanity guard).

Self-contained (no `.pte`/export), so it runs inside `webgpu_native_test` under `test_webgpu_native_ci.sh` with no new wiring. Absolute rms_norm correctness stays covered by the model-driven golden tests; this adds the "128 matches 64" guarantee.

Co-authored-with: Claude Code.
ghstack-source-id: 403097259
@exported-using-ghexport

Differential Revision: [D112060302](https://our.internmc.facebook.com/intern/diff/D112060302/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants